<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>后台管理 - 开心买</title>
	<link type="text/css" rel="stylesheet" href="${project_name}/css/style.css" />
	<script type="text/javascript" src="${project_name}/js/jquery-1.8.3.js"></script>
	<script src="${project_name}/js/product-add.js"></script>
	<script>$(function(){$('.clearfix li:eq(2)').addClass('current');});</script>
	<script>
		$(function () {
			$.ajax({
					url:'${project_name}/back_product/findFirstType',
					type: 'post',    // 请求方式
					traditional:true,
					async: false,    // 默认true 异步请求 同步为false
					success: function (data) {

					}
				})

			$('#firstTypes').change(function () {
				$.ajax({
					url:'${project_name}/back_product/findSecond',
					type:'post',//请求方式x
					async:'true',//默认true 异步请求 同步需要设置成false
					data:{firstTypeId:$(this).val()}, //传入后台的参数
					success:function (data) {

					}
				})
			})

			getAllFirstType("${project_name}")

			$("#firstTypes").change(function () {
				getSecondaryType("${project_name}", $("#firstTypes").val())
			})

			$("#firstTypes").change()
		})
	</script>
</head>
<body>
<jsp:include page="public_header.jsp" />
<div id="main" class="wrap">
	<c:import url="public_menu.jsp"></c:import>
	<div class="main">
		<h2>添加商品</h2>
		<div class="manage">
			<form action="" id="myform" method="post" enctype="multipart/form-data">
				<table class="form">
					<tr>
						<td class="field">商品名称：</td>
                                                                                                                                                                                                                    						<td><input type="text" class="text" name="name" value="" /></td>
						<td><span class="name" style="color:red"></span></td>
					</tr>
					<tr>
						<td class="field">所属分类：</td>
						<td>
							<select name="" id="firstTypes" >

							</select>
							<select name="" id="secondaryTypeList" >

							</select>
						</td>
					</tr>
					<tr>
						<td class="field">商品图片：</td>
						<td><input type="file" class="text" name="" /></td>
					</tr>
					<tr>
						<td class="field">商品价格：</td>
						<td><input type="text" class="text tiny" name="" value="1" /> 元</td>
						<td><span class="jg" style="color:red"></span></td>
					</tr>
					<tr>
						<td class="field">库存：</td>
						<td><input type="text" class="text tiny" name="" value="1" /></td>
						<td><span class="kc" style="color:red"></span></td>
					</tr>
					<tr>
						<td></td>
						<td><label class="ui-blue"><input type="submit" name="submit" value="添加" /></label></td>
					</tr>
				</table>
			</form>
		</div>
	</div>
	<div class="clear"></div>
</div>
<div id="footer">
	Copyright &copy; 2010 极客营 All Rights Reserved. 京ICP证801001号
</div>
</body>
</html>
